using System;
using System.Collections.Generic;

namespace twimillar2
{
	public class UserConfig : IUserConfig
	{
		private readonly Action<string> _action;
		private readonly Func<string, IEnumerable<KeyValuePair<double, string>>> _func;

		public UserConfig(Action<string> action, Func<string, IEnumerable<KeyValuePair<double, string>>> func)
		{
			_action = action;
			_func = func;
		}

		public IEnumerable<KeyValuePair<double, string>> ForUser(string userName)
		{
			_action(userName);
			return _func(userName);
		}
	}
}